﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using ClassLibrary.Configuration.WireCloud;
using ClassLibrary;

namespace WireCloudConfigGenerator
{
    class Program
    {
        static void Main(string[] args)
        {
            const String outputPath = @"c://WireCloudConfiguration.xml";

            var RoutingTable = new List<Link>();

            RoutingTable.Add(new Link("A", "1", 1, 1));
            RoutingTable.Add(new Link("A", "1", 1, 1));
            RoutingTable.Add(new Link("1", "1", 1, 1));
            RoutingTable.Add(new Link("1", "1", 1, 1));
            RoutingTable.Add(new Link("1", "1", 1, 1));
 

            var CloudConfig = new WireCloudConfig(){cloudPort = 9050, Links = RoutingTable};
            var writer = new XmlSerializer(typeof(WireCloudConfig));
            using (var file = File.Create(outputPath))
            {
                writer.Serialize(file, CloudConfig);
            }
        }
    }
}
